package com.xx.springboot.utils;/**
 * Created by xiaoxiunique on 2018-11-20.
 */

import com.xx.springboot.entity.User;
import org.apache.shiro.SecurityUtils;

/**
 * <p>
 * TODO:
 * </p>
 *
 * @author hcg
 * @date 2018-11-20 11:33
 * @className UserUtils
 */
public class UserUtils {

    /**
     * <p>
     *      返回登录用户的信息
     * </p>
     * @Author hcg
     * @Date 2018-11-20 11:34
     * @Param []
     * @return com.xx.springboot.entity.User
     **/
    public static User getUser() {
        User user = (User) SecurityUtils.getSubject().getPrincipal();
        return user;
    }
}
